//
//  WBNavigationController.swift
//  SinaWB
//
//  Created by 财神软件 on 17/2/7.
//  Copyright © 2017年 财神软件. All rights reserved.
//

import UIKit

class WBNavigationController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.navigationBar.isHidden=true
        // Do any additional setup after loading the view.
    }

    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        if viewControllers.count>0 {
            viewController.hidesBottomBarWhenPushed=true
            if let VC=viewController as?WBBaseViewController {
                VC.navitem.leftBarButtonItems=[UIBarButtonItem.init(normalimage: UIImage.init(named: "back"), heightimage: UIImage.init(named: "back"), target: self, action: #selector(back))]
            }
            
        }
        
        super.pushViewController(viewController, animated: animated)
    }
    func back()  {
        self.popViewController(animated: true)
    }
}
